home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / PInterfaces / InputSprocket.p < prev    next >
Encoding:
Text File  |  1998-02-12  |  24.3 KB  |  802 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        InputSprocket.p
  3.  
  4.      Contains:    Games Sprockets: InputSprocket interfaaces
  5.  
  6.      Version:    Technology:    Input Sprocket 1.2
  7.                  Release:    Universal Interfaces 3.1
  8.  
  9.      Copyright:    © 1996-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT InputSprocket;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __INPUTSPROCKET__}
  28. {$SETC __INPUTSPROCKET__ := 1}
  29.  
  30. {$I+}
  31. {$SETC InputSprocketIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __MACTYPES__}
  35. {$I MacTypes.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __EVENTS__}
  38. {$I Events.p}
  39. {$ENDC}
  40.  
  41.  
  42. {$PUSH}
  43. {$ALIGN POWER}
  44. {$LibExport+}
  45.  
  46. {$IFC UNDEFINED USE_OLD_INPUT_SPROCKET_LABELS }
  47. {$SETC USE_OLD_INPUT_SPROCKET_LABELS := 1 }
  48. {$ENDC}
  49.  
  50. {$IFC UNDEFINED USE_OLD_ISPNEED_STRUCT }
  51. {$SETC USE_OLD_ISPNEED_STRUCT := 1 }
  52. {$ENDC}
  53.  
  54. {$IFC TARGET_CPU_PPC }
  55. { ********************* data types ********************* }
  56.  
  57. TYPE
  58.     ISpDeviceReference = ^LONGINT;
  59.     ISpElementReference = ^LONGINT;
  60.     ISpElementListReference = ^LONGINT;
  61. { ISpDeviceClass is a general classs of device, example: keyboard, mouse, joystick }
  62.     ISpDeviceClass                        = OSType;
  63. { ISpDeviceIdentifier is a specific device,  example: standard 1-button mouse, 105key ext. kbd. }
  64.     ISpDeviceIdentifier                    = OSType;
  65.     ISpElementLabel                        = OSType;
  66.     ISpElementKind                        = OSType;
  67.  
  68. { *************** errors -30420 to -30439***************** }
  69.  
  70. CONST
  71.     kISpInternalErr                = -30420;
  72.     kISpSystemListErr            = -30421;
  73.     kISpBufferToSmallErr        = -30422;
  74.     kISpElementInListErr        = -30423;
  75.     kISpElementNotInListErr        = -30424;
  76.     kISpSystemInactiveErr        = -30425;
  77.     kISpDeviceInactiveErr        = -30426;
  78.     kISpSystemActiveErr            = -30427;
  79.     kISpDeviceActiveErr            = -30428;
  80.     kISpListBusyErr                = -30429;
  81.  
  82. { *************** resources **************** }
  83.     kISpApplicationResourceType    = 'isap';
  84.     kISpSetListResourceType        = 'setl';
  85.     kISpSetDataResourceType        = 'setd';
  86.  
  87.  
  88. TYPE
  89.     ISpApplicationResourceStructPtr = ^ISpApplicationResourceStruct;
  90.     ISpApplicationResourceStruct = RECORD
  91.         flags:                    UInt32;
  92.         reserved1:                UInt32;
  93.         reserved2:                UInt32;
  94.         reserved3:                UInt32;
  95.     END;
  96.  
  97.  
  98. CONST
  99.     kISpAppResFlag_UsesInputSprocket = $00000001;                {  true if the application uses InputSprocket }
  100.     kISpAppResFlag_UsesISpInit    = $00000002;                    {  true if the calls ISpInit (ie, uses the high level interface, calls ISpConfigure, has a needs list, etc...) }
  101.  
  102. {
  103.  * ISpDeviceDefinition
  104.  *
  105.  * This structure provides all the available
  106.  * information for an input device within the system
  107.  *
  108.  }
  109.  
  110. TYPE
  111.     ISpDeviceDefinitionPtr = ^ISpDeviceDefinition;
  112.     ISpDeviceDefinition = RECORD
  113.         deviceName:                Str63;                                    {  a human readable name of the device  }
  114.         theDeviceClass:            ISpDeviceClass;                            {  general classs of device example : keyboard, mouse, joystick  }
  115.         theDeviceIdentifier:    ISpDeviceIdentifier;                    {  every distinguishable device should have an OSType  }
  116.         permanentID:            UInt32;                                    {  a cross reboot id unique within that deviceType, 0 if not possible  }
  117.         flags:                    UInt32;                                    {  status flags  }
  118.         reserved1:                UInt32;
  119.         reserved2:                UInt32;
  120.         reserved3:                UInt32;
  121.     END;
  122.  
  123.  
  124. CONST
  125.     kISpDeviceFlag_HandleOwnEmulation = 1;
  126.  
  127. {
  128.  * ISpElementEvent, ISpElementEventPtr
  129.  *
  130.  * This is the structure that event data is passed in.
  131.  *
  132.  }
  133.  
  134. TYPE
  135.     ISpElementEventPtr = ^ISpElementEvent;
  136.     ISpElementEvent = RECORD
  137.         when:                    AbsoluteTime;                            {  this is absolute time on PCI or later, otherwise it is  }
  138.                                                                         {  0 for the hi 32 bits and TickCount for the low 32 bits  }
  139.         element:                ISpElementReference;                    {  a reference to the element that generated this event  }
  140.         refCon:                    UInt32;                                    {  for application usage, 0 on the global list  }
  141.         data:                    UInt32;                                    {  the data for this event  }
  142.     END;
  143.  
  144. {
  145.  * ISpElementInfo, ISpElementInfoPtr
  146.  *
  147.  * This is the generic definition of an element.
  148.  * Every element must contain this information.
  149.  *
  150.  }
  151.     ISpElementInfoPtr = ^ISpElementInfo;
  152.     ISpElementInfo = RECORD
  153.         theLabel:                ISpElementLabel;
  154.         theKind:                ISpElementKind;
  155.         theString:                Str63;
  156.         reserved1:                UInt32;
  157.         reserved2:                UInt32;
  158.     END;
  159.  
  160.     ISpNeedFlagBits                        = UInt32;
  161. {$IFC USE_OLD_ISPNEED_STRUCT }
  162.     ISpNeedPtr = ^ISpNeed;
  163.     ISpNeed = RECORD
  164.         name:                    Str63;
  165.         iconSuiteResourceId:    INTEGER;                                {  resource id of the icon suite  }
  166.         reserved:                INTEGER;
  167.         theKind:                ISpElementKind;
  168.         theLabel:                ISpElementLabel;
  169.         flags:                    ISpNeedFlagBits;
  170.         reserved1:                UInt32;
  171.         reserved2:                UInt32;
  172.         reserved3:                UInt32;
  173.     END;
  174.  
  175. {$ELSEC}
  176.     ISpNeed = RECORD
  177.         name:                    Str63;                                    {  human-readable string  }
  178.         iconSuiteResourceId:    INTEGER;                                {  resource id of the icon suite  }
  179.         playerNum:                SInt8;                                    {  used for multi-player support  }
  180.         group:                    SInt8;                                    {  used to group related needs (eg, look left and look right button needs)  }
  181.         theKind:                ISpElementKind;
  182.         theLabel:                ISpElementLabel;
  183.         flags:                    ISpNeedFlagBits;
  184.         reserved1:                UInt32;
  185.         reserved2:                UInt32;
  186.         reserved3:                UInt32;
  187.     END;
  188.  
  189. {$ENDC}
  190.  
  191. CONST
  192.     kISpNeedFlag_NoMultiConfig    = $00000001;                    {  once this need is autoconfigured to one device dont autoconfigure to anything else }
  193.     kISpNeedFlag_Utility        = $00000002;                    {  this need is a utility function (like show framerate) which would not typically be assigned to anything but the keyboard }
  194.     kISpNeedFlag_PolledOnly        = $00000004;
  195.     kISpNeedFlag_EventsOnly        = $00000008;                    {  *** kISpElementKind specific flags *** }
  196.                                                                 {  these are flags specific to kISpElementKind_Button }
  197.     kISpNeedFlag_Button_AlreadyAxis = $10000000;                {  there is a axis version of this button need }
  198.     kISpNeedFlag_Button_ClickToggles = $20000000;
  199.     kISpNeedFlag_Button_ActiveWhenDown = $40000000;                {  these are flags specific to kISpElementKind_DPad }
  200.                                                                 {  these are flags specific to kISpElementKind_Axis }
  201.     kISpNeedFlag_Axis_AlreadyButton = $10000000;                {  there is a button version of this axis need }
  202.     kISpNeedFlag_Axis_Asymetric    = $20000000;                    {  this axis need is asymetric     }
  203.                                                                 {  these are flags specific to kISpElementKind_Delta }
  204.     kISpNeedFlag_Delta_AlreadyAxis = $10000000;                    {  there is a axis version of this delta need }
  205.  
  206. {
  207.  *
  208.  * These are the current built values for ISpDeviceClass
  209.  *
  210.  }
  211.     kISpDeviceClass_SpeechRecognition = 'talk';
  212.     kISpDeviceClass_Mouse        = 'mous';
  213.     kISpDeviceClass_Keyboard    = 'keyd';
  214.     kISpDeviceClass_Joystick    = 'joys';
  215.     kISpDeviceClass_Wheel        = 'whel';
  216.     kISpDeviceClass_Pedals        = 'pedl';
  217.     kISpDeviceClass_Levers        = 'levr';
  218.     kISpDeviceClass_Tickle        = 'tckl';                        {  a device of this class requires ISpTickle }
  219.  
  220. {
  221.  * These are the current built in ISpElementKind's
  222.  * 
  223.  * These are all OSTypes.
  224.  *
  225.  }
  226.     kISpElementKind_Button        = 'butn';
  227.     kISpElementKind_DPad        = 'dpad';
  228.     kISpElementKind_Axis        = 'axis';
  229.     kISpElementKind_Delta        = 'dlta';
  230.     kISpElementKind_Movement    = 'move';
  231.     kISpElementKind_Virtual        = 'virt';
  232.  
  233.  
  234. {
  235.  *
  236.  * These are the current built in ISpElementLabel's
  237.  *
  238.  * These are all OSTypes.
  239.  *
  240.  }
  241. {$IFC USE_OLD_INPUT_SPROCKET_LABELS }
  242.                                                                 {  axis  }
  243.     kISpElementLabel_XAxis        = 'xaxi';
  244.     kISpElementLabel_YAxis        = 'yaxi';
  245.     kISpElementLabel_ZAxis        = 'zaxi';
  246.     kISpElementLabel_Rx            = 'rxax';
  247.     kISpElementLabel_Ry            = 'ryax';
  248.     kISpElementLabel_Rz            = 'rzax';
  249.     kISpElementLabel_Gas        = 'gasp';
  250.     kISpElementLabel_Brake        = 'brak';
  251.     kISpElementLabel_Clutch        = 'cltc';
  252.     kISpElementLabel_Throttle    = 'thrt';
  253.     kISpElementLabel_Trim        = 'trim';                        {  direction pad  }
  254.     kISpElementLabel_POVHat        = 'povh';
  255.     kISpElementLabel_PadMove    = 'move';                        {  buttons  }
  256.     kISpElementLabel_Fire        = 'fire';
  257.     kISpElementLabel_Start        = 'strt';
  258.     kISpElementLabel_Select        = 'optn';
  259.  
  260. {$ENDC}
  261.                                                                 {  generic  }
  262.     kISpElementLabel_None        = 'none';                        {  axis  }
  263.     kISpElementLabel_Axis_XAxis    = 'xaxi';
  264.     kISpElementLabel_Axis_YAxis    = 'yaxi';
  265.     kISpElementLabel_Axis_ZAxis    = 'zaxi';
  266.     kISpElementLabel_Axis_Rx    = 'rxax';
  267.     kISpElementLabel_Axis_Ry    = 'ryax';
  268.     kISpElementLabel_Axis_Rz    = 'rzax';
  269.     kISpElementLabel_Axis_Roll    = 'rzax';
  270.     kISpElementLabel_Axis_Pitch    = 'rxax';
  271.     kISpElementLabel_Axis_Yaw    = 'ryax';
  272.     kISpElementLabel_Axis_RollTrim = 'rxtm';
  273.     kISpElementLabel_Axis_PitchTrim = 'trim';
  274.     kISpElementLabel_Axis_YawTrim = 'rytm';
  275.     kISpElementLabel_Axis_Gas    = 'gasp';
  276.     kISpElementLabel_Axis_Brake    = 'brak';
  277.     kISpElementLabel_Axis_Clutch = 'cltc';
  278.     kISpElementLabel_Axis_Throttle = 'thrt';
  279.     kISpElementLabel_Axis_Trim    = 'trim';
  280.     kISpElementLabel_Axis_Rudder = 'rudd';                        {  delta  }
  281.     kISpElementLabel_Delta_X    = 'xdlt';
  282.     kISpElementLabel_Delta_Y    = 'ydlt';
  283.     kISpElementLabel_Delta_Z    = 'zdlt';
  284.     kISpElementLabel_Delta_Rx    = 'rxdl';
  285.     kISpElementLabel_Delta_Ry    = 'rydl';
  286.     kISpElementLabel_Delta_Rz    = 'rzdl';
  287.     kISpElementLabel_Delta_Roll    = 'rzdl';
  288.     kISpElementLabel_Delta_Pitch = 'rxdl';
  289.     kISpElementLabel_Delta_Yaw    = 'rydl';                        {  direction pad  }
  290.     kISpElementLabel_Pad_POV    = 'povh';
  291.     kISpElementLabel_Pad_Move    = 'move';                        {  buttons  }
  292.     kISpElementLabel_Btn_Fire    = 'fire';
  293.     kISpElementLabel_Btn_SecondaryFire = 'sfir';
  294.     kISpElementLabel_Btn_Jump    = 'jump';
  295.     kISpElementLabel_Btn_PauseResume = 'strt';                    {  kISpElementLabel_Btn_PauseResume automatically binds to escape  }
  296.     kISpElementLabel_Btn_Select    = 'optn';
  297.     kISpElementLabel_Btn_SlideLeft = 'blft';
  298.     kISpElementLabel_Btn_SlideRight = 'brgt';
  299.     kISpElementLabel_Btn_MoveForward = 'btmf';
  300.     kISpElementLabel_Btn_MoveBackward = 'btmb';
  301.     kISpElementLabel_Btn_TurnLeft = 'bttl';
  302.     kISpElementLabel_Btn_TurnRight = 'bttr';
  303.     kISpElementLabel_Btn_LookLeft = 'btll';
  304.     kISpElementLabel_Btn_LookRight = 'btlr';
  305.     kISpElementLabel_Btn_LookUp    = 'btlu';
  306.     kISpElementLabel_Btn_LookDown = 'btld';
  307.     kISpElementLabel_Btn_Next    = 'btnx';
  308.     kISpElementLabel_Btn_Previous = 'btpv';
  309.     kISpElementLabel_Btn_SideStep = 'side';
  310.     kISpElementLabel_Btn_Run    = 'quik';
  311.     kISpElementLabel_Btn_Look    = 'blok';
  312.  
  313. {
  314.  *
  315.  * direction pad data & configuration information
  316.  *
  317.  }
  318.  
  319. TYPE
  320.     ISpDPadData                            = UInt32;
  321.  
  322. CONST
  323.     kISpPadIdle                    = 0;
  324.     kISpPadLeft                    = 1;
  325.     kISpPadUpLeft                = 2;
  326.     kISpPadUp                    = 3;
  327.     kISpPadUpRight                = 4;
  328.     kISpPadRight                = 5;
  329.     kISpPadDownRight            = 6;
  330.     kISpPadDown                    = 7;
  331.     kISpPadDownLeft                = 8;
  332.  
  333.  
  334. TYPE
  335.     ISpDPadConfigurationInfoPtr = ^ISpDPadConfigurationInfo;
  336.     ISpDPadConfigurationInfo = RECORD
  337.         id:                        UInt32;                                    {  ordering 1..n, 0 = no relavent ordering of direction pads  }
  338.         fourWayPad:                BOOLEAN;                                {  true if this pad can only produce idle + four directions  }
  339.     END;
  340.  
  341. {
  342.  *
  343.  * button data & configuration information
  344.  *
  345.  }
  346.     ISpButtonData                        = UInt32;
  347.  
  348. CONST
  349.     kISpButtonUp                = 0;
  350.     kISpButtonDown                = 1;
  351.  
  352.  
  353. TYPE
  354.     ISpButtonConfigurationInfoPtr = ^ISpButtonConfigurationInfo;
  355.     ISpButtonConfigurationInfo = RECORD
  356.         id:                        UInt32;                                    {  ordering 1..n, 0 = no relavent ordering of buttons  }
  357.     END;
  358.  
  359. {
  360.  *
  361.  * axis data & configuration information 
  362.  *
  363.  }
  364.     ISpAxisData                            = UInt32;
  365.     ISpAxisConfigurationInfoPtr = ^ISpAxisConfigurationInfo;
  366.     ISpAxisConfigurationInfo = RECORD
  367.         symetricAxis:            BOOLEAN;                                {  axis is symetric, i.e. a joystick is symetric and a gas pedal is not  }
  368.     END;
  369.  
  370.     ISpDeltaData                        = Fixed;
  371.     ISpDeltaConfigurationInfoPtr = ^ISpDeltaConfigurationInfo;
  372.     ISpDeltaConfigurationInfo = RECORD
  373.         reserved1:                UInt32;
  374.         reserved2:                UInt32;
  375.     END;
  376.  
  377.     ISpMovementDataPtr = ^ISpMovementData;
  378.     ISpMovementData = RECORD
  379.         xAxis:                    ISpAxisData;
  380.         yAxis:                    ISpAxisData;
  381.         direction:                ISpDPadData;                            {  ISpDPadData version of the movement  }
  382.     END;
  383.  
  384.  
  385. CONST
  386.     kISpVirtualElementFlag_UseTempMem = 1;
  387.  
  388.     kISpElementListFlag_UseTempMem = 1;
  389.  
  390.     kISpFirstIconSuite            = 30000;
  391.     kISpLastIconSuite            = 30100;
  392.     kISpNoneIconSuite            = 30000;
  393.  
  394. { ********************* user level functions ********************* }
  395.  
  396.  
  397. {
  398.  *
  399.  * startup / shutdown
  400.  *
  401.  }
  402. FUNCTION ISpStartup: OSStatus; C;
  403. {  1.1 or later }
  404. FUNCTION ISpShutdown: OSStatus; C;
  405. {  1.1 or later }
  406. {
  407.  *
  408.  * polling
  409.  *
  410.  }
  411. FUNCTION ISpTickle: OSStatus; C;
  412. {  1.1 or later }
  413. {********* user interface functions *********}
  414.  
  415. FUNCTION ISpGetVersion: NumVersion; C;
  416. {
  417.  *
  418.  * ISpElement_NewVirtual(ISpElementReference *outElement);
  419.  *
  420.  }
  421. FUNCTION ISpElement_NewVirtual(dataSize: UInt32; VAR outElement: ISpElementReference; flags: UInt32): OSStatus; C;
  422. {
  423.  *
  424.  * ISpElement_NewVirtualFromNeeds(UInt32 count, ISpNeeds *needs, ISpElementReference *outElements);
  425.  *
  426.  }
  427. FUNCTION ISpElement_NewVirtualFromNeeds(count: UInt32; VAR needs: ISpNeed; VAR outElements: ISpElementReference; flags: UInt32): OSStatus; C;
  428. {
  429.  *
  430.  * ISpElement_DisposeVirtual(inElement);
  431.  *
  432.  }
  433. FUNCTION ISpElement_DisposeVirtual(count: UInt32; VAR inElements: ISpElementReference): OSStatus; C;
  434. {
  435.  * ISpInit
  436.  *
  437.  }
  438. FUNCTION ISpInit(count: UInt32; VAR needs: ISpNeed; VAR inReferences: ISpElementReference; appCreatorCode: OSType; subCreatorCode: OSType; flags: UInt32; setListResourceId: INTEGER; reserved: UInt32): OSStatus; C;
  439.  
  440. {
  441.  * ISpConfigure
  442.  *
  443.  }
  444.  
  445. TYPE
  446. {$IFC TYPED_FUNCTION_POINTERS}
  447.     ISpEventProcPtr = FUNCTION(VAR inEvent: EventRecord): BOOLEAN; C;
  448. {$ELSEC}
  449.     ISpEventProcPtr = ProcPtr;
  450. {$ENDC}
  451.  
  452. FUNCTION ISpConfigure(inEventProcPtr: ISpEventProcPtr): OSStatus; C;
  453. {
  454.  *
  455.  * ISpStop
  456.  *
  457.  }
  458. FUNCTION ISpStop: OSStatus; C;
  459. {
  460.  *
  461.  * ISpSuspend, ISpResume
  462.  *
  463.  * ISpSuspend turns all devices off and allocates memory so that the state may be later resumed.
  464.  * ISpResume resumes to the previous state of the system after a suspend call.
  465.  * 
  466.  * Return Codes
  467.  * memFullErr
  468.  *
  469.  }
  470. FUNCTION ISpSuspend: OSStatus; C;
  471. FUNCTION ISpResume: OSStatus; C;
  472. {
  473.  * ISpDevices_Extract, ISpDevices_ExtractByClass, ISpDevices_ExtractByIdentifier
  474.  *
  475.  * These will extract as many device references from the system wide list as will fit in your buffer.  
  476.  *
  477.  * inBufferCount - the size of your buffer (in units of sizeof(ISpDeviceReference)) this may be zero
  478.  * buffer - a pointer to your buffer
  479.  * outCount - contains the number of devices in the system
  480.  *
  481.  * ISpDevices_ExtractByClass extracts and counts devices of the specified ISpDeviceClass
  482.  * ISpDevices_ExtractByIdentifier extracts and counts devices of the specified ISpDeviceIdentifier
  483.  *
  484.  * Return Codes
  485.  * paramErr
  486.  *
  487.  }
  488. FUNCTION ISpDevices_Extract(inBufferCount: UInt32; VAR outCount: UInt32; VAR buffer: ISpDeviceReference): OSStatus; C;
  489. FUNCTION ISpDevices_ExtractByClass(inClass: ISpDeviceClass; inBufferCount: UInt32; VAR outCount: UInt32; VAR buffer: ISpDeviceReference): OSStatus; C;
  490. FUNCTION ISpDevices_ExtractByIdentifier(inIdentifier: ISpDeviceIdentifier; inBufferCount: UInt32; VAR outCount: UInt32; VAR buffer: ISpDeviceReference): OSStatus; C;
  491.  
  492. {
  493.  * ISpDevices_ActivateClass, ISpDevices_DeactivateClass, ISpDevices_Activate, ISpDevices_Deactivate, ISpDevice_IsActive
  494.  *
  495.  * ISpDevices_Activate, ISpDevices_Deactivate
  496.  *
  497.  * This will activate/deactivate a block of devices.
  498.  * inDeviceCount - the number of devices to activate / deactivate
  499.  * inDevicesToActivate/inDevicesToDeactivate - a pointer to a block of memory contains the devices references
  500.  *
  501.  * ISpDevices_ActivateClass, ISpDevices_DeactivateClass
  502.  * inClass - the class of devices to activate or deactivate
  503.  *
  504.  * ISpDevice_IsActive
  505.  * inDevice - the device reference that you wish to 
  506.  * outIsActive - a boolean value that is true when the device is active
  507.  *
  508.  * Return Codes
  509.  * paramErr
  510.  *
  511.  }
  512. FUNCTION ISpDevices_ActivateClass(inClass: ISpDeviceClass): OSStatus; C;
  513. {  1.1 or later }
  514. FUNCTION ISpDevices_DeactivateClass(inClass: ISpDeviceClass): OSStatus; C;
  515. {  1.1 or later }
  516. FUNCTION ISpDevices_Activate(inDeviceCount: UInt32; VAR inDevicesToActivate: ISpDeviceReference): OSStatus; C;
  517. FUNCTION ISpDevices_Deactivate(inDeviceCount: UInt32; VAR inDevicesToDeactivate: ISpDeviceReference): OSStatus; C;
  518. FUNCTION ISpDevice_IsActive(inDevice: ISpDeviceReference; VAR outIsActive: BOOLEAN): OSStatus; C;
  519. {
  520.  * ISpDevice_GetDefinition
  521.  *
  522.  *
  523.  * inDevice - the device you want to get the definition for
  524.  * inBuflen - the size of the structure (sizeof(ISpDeviceDefinition))
  525.  * outStruct - a pointer to where you want the structure copied
  526.  *
  527.  * Return Codes
  528.  * paramErr
  529.  *
  530.  }
  531. FUNCTION ISpDevice_GetDefinition(inDevice: ISpDeviceReference; inBuflen: UInt32; VAR outStruct: ISpDeviceDefinition): OSStatus; C;
  532.  
  533. {
  534.  *
  535.  * ISpDevice_GetElementList
  536.  *
  537.  * inDevice - the device whose element list you wish to get
  538.  * outElementList - a pointer to where you want a reference to that list stored
  539.  *
  540.  * Return Codes
  541.  * paramErr
  542.  *
  543.  }
  544. FUNCTION ISpDevice_GetElementList(inDevice: ISpDeviceReference; VAR outElementList: ISpElementListReference): OSStatus; C;
  545. {
  546.  *
  547.  * takes an ISpElementReference and returns the group that it is in or 0 if there is
  548.  * no group
  549.  *
  550.  * Return Codes
  551.  * paramErr
  552.  *
  553.  }
  554. FUNCTION ISpElement_GetGroup(inElement: ISpElementReference; VAR outGroup: UInt32): OSStatus; C;
  555. {
  556.  *
  557.  * takes an ISpElementReference and returns the device that the element belongs 
  558.  * to.
  559.  *
  560.  * Return Codes
  561.  * paramErr if inElement is 0 or outDevice is nil
  562.  *
  563.  }
  564. FUNCTION ISpElement_GetDevice(inElement: ISpElementReference; VAR outDevice: ISpDeviceReference): OSStatus; C;
  565. {
  566.  *
  567.  * takes an ISpElementReference and gives the ISpElementInfo for that Element.  This is the
  568.  * the set of standard information.  You get ISpElementKind specific information
  569.  * through ISpElement_GetConfigurationInfo.
  570.  *
  571.  * Return Codes
  572.  * paramErr if inElement is 0 or outInfo is nil
  573.  *
  574.  }
  575. FUNCTION ISpElement_GetInfo(inElement: ISpElementReference; outInfo: ISpElementInfoPtr): OSStatus; C;
  576. {
  577.  *
  578.  *         
  579.  *
  580.  * takes an ISpElementReference and gives the ISpElementKind specific configuration information
  581.  * 
  582.  * if buflen is not long enough to hold the information ISpElement_GetConfigurationInfo will
  583.  * copy buflen bytes of the data into the block of memory pointed to by configInfo and
  584.  * will return something error.
  585.  *
  586.  * Return Codes
  587.  * paramErr if inElement or configInfo is nil
  588.  *
  589.  }
  590. FUNCTION ISpElement_GetConfigurationInfo(inElement: ISpElementReference; buflen: UInt32; configInfo: UNIV Ptr): OSStatus; C;
  591. {
  592.  *
  593.  * ISpElement_GetSimpleState
  594.  *
  595.  * Takes an ISpElementReference and returns the current state of that element.  This is a 
  596.  * specialized version of ISpElement_GetComplexState that is only appropriate for elements
  597.  * whose data fits in a signed 32 bit integer.
  598.  *
  599.  *
  600.  *
  601.  * Return Codes
  602.  * paramErr if inElement is 0 or state is nil
  603.  *
  604.  }
  605. FUNCTION ISpElement_GetSimpleState(inElement: ISpElementReference; VAR state: UInt32): OSStatus; C;
  606. {
  607.  *
  608.  * ISpElement_GetComplexState
  609.  *
  610.  * Takes an ISpElementReference and returns the current state of that element.  
  611.  * Will copy up to buflen bytes of the current state of the device into
  612.  * state.
  613.  *
  614.  *
  615.  * Return Codes
  616.  * paramErr if inElement is 0 or state is nil
  617.  *
  618.  }
  619. FUNCTION ISpElement_GetComplexState(inElement: ISpElementReference; buflen: UInt32; state: UNIV Ptr): OSStatus; C;
  620.  
  621. {
  622.  * ISpElement_GetNextEvent
  623.  *
  624.  * It takes in an element  reference and the buffer size of the ISpElementEventPtr
  625.  * it will set wasEvent to true if there was an event and false otherwise.  If there
  626.  * was not enough space to fill in the whole event structure that event will be
  627.  * dequed, as much of the event as will fit in the buffer will by copied and
  628.  * ISpElement_GetNextEvent will return an error.
  629.  *
  630.  * Return Codes
  631.  * paramErr
  632.  *
  633.  }
  634. FUNCTION ISpElement_GetNextEvent(inElement: ISpElementReference; bufSize: UInt32; event: ISpElementEventPtr; VAR wasEvent: BOOLEAN): OSStatus; C;
  635. {
  636.  *
  637.  * ISpElement_Flush
  638.  *
  639.  * It takes an ISpElementReference and flushes all the events on that element.  All it guaruntees is
  640.  * that any events that made it to this layer before the time of the flush call will be flushed and
  641.  * it will not flush any events that make it to this layer after the time when the call has returned.
  642.  * What happens to events that occur during the flush is undefined.
  643.  *
  644.  *
  645.  * Return Codes
  646.  * paramErr
  647.  *
  648.  }
  649. FUNCTION ISpElement_Flush(inElement: ISpElementReference): OSStatus; C;
  650.  
  651.  
  652. {
  653.  * ISpElementList_New
  654.  *
  655.  * Creates a new element list and returns it in outElementList.  In count specifies 
  656.  * the number of element references in the list pointed to by inElements.  If inCount
  657.  * is non zero the list is created with inCount elements in at as specified by the 
  658.  * inElements parameter.  Otherwise the list is created empty.
  659.  *
  660.  *
  661.  * Return Codes
  662.  * out of memory - If it failed to allocate the list because it was out of memory
  663.                    it will also set outElementList to 0
  664.  * paramErr if outElementList was nil
  665.  *
  666.  *
  667.  * Special Concerns
  668.  *
  669.  * interrupt unsafe
  670.  *
  671.  }
  672. FUNCTION ISpElementList_New(inCount: UInt32; VAR inElements: ISpElementReference; VAR outElementList: ISpElementListReference; flags: UInt32): OSStatus; C;
  673. {
  674.  * ISpElementList_Dispose
  675.  *
  676.  * Deletes an already existing memory list.  
  677.  *
  678.  *
  679.  * Return Codes
  680.  * paramErr if inElementList was 0
  681.  *
  682.  *
  683.  * Special Concerns
  684.  *
  685.  * interrupt unsafe
  686.  *
  687.  }
  688. FUNCTION ISpElementList_Dispose(inElementList: ISpElementListReference): OSStatus; C;
  689. {
  690.  * ISpGetGlobalElementList
  691.  *
  692.  * returns the global element list
  693.  *
  694.  * Return Codes
  695.  * paramErr if outElementList is nil
  696.  *
  697.  }
  698. FUNCTION ISpGetGlobalElementList(VAR outElementList: ISpElementListReference): OSStatus; C;
  699. {
  700.  * ISpElementList_AddElement
  701.  *
  702.  * adds an element to the element list
  703.  *
  704.  * Return Codes
  705.  * paramErr if inElementList is 0 or newElement is 0
  706.  * memory error if the system is unable to allocate enough memory
  707.  *
  708.  * Special Concerns
  709.  * interrupt Unsafe
  710.  * 
  711.  }
  712. FUNCTION ISpElementList_AddElements(inElementList: ISpElementListReference; refCon: UInt32; count: UInt32; VAR newElements: ISpElementReference): OSStatus; C;
  713. {
  714.  * ISpElementList_RemoveElement
  715.  *
  716.  * removes the specified element from the element list
  717.  *
  718.  * Return Codes
  719.  * paramErr if inElementList is 0 or oldElement is 0
  720.  * memory error if the system is unable to allocate enough memory
  721.  *
  722.  * Special Concerns
  723.  * interrupt Unsafe
  724.  * 
  725.  }
  726. FUNCTION ISpElementList_RemoveElements(inElementList: ISpElementListReference; count: UInt32; VAR oldElement: ISpElementReference): OSStatus; C;
  727. {
  728.  * ISpElementList_Extract
  729.  *
  730.  * ISpElementList_Extract will extract as many of the elements from an element list as possible.  You pass
  731.  * in an element list, a pointer to an array of element references and the number of elements in that array.
  732.  * It will return how many items are in the element list in the outCount parameter and copy the minimum of 
  733.  * that number and the size of the array into the buffer.
  734.  *
  735.  * ByKind and ByLabel are the same except that they will only count and copy element references to elements
  736.  * that have the specified kind and label.
  737.  *
  738.  * Return Codes
  739.  * paramErr
  740.  *
  741.  }
  742. FUNCTION ISpElementList_Extract(inElementList: ISpElementListReference; inBufferCount: UInt32; VAR outCount: UInt32; VAR buffer: ISpElementReference): OSStatus; C;
  743. FUNCTION ISpElementList_ExtractByKind(inElementList: ISpElementListReference; inKind: ISpElementKind; inBufferCount: UInt32; VAR outCount: UInt32; VAR buffer: ISpElementReference): OSStatus; C;
  744. FUNCTION ISpElementList_ExtractByLabel(inElementList: ISpElementListReference; inLabel: ISpElementLabel; inBufferCount: UInt32; VAR outCount: UInt32; VAR buffer: ISpElementReference): OSStatus; C;
  745. {
  746.  * ISpElementList_GetNextEvent
  747.  *
  748.  * It takes in an element list reference and the buffer size of the ISpElementEventPtr
  749.  * it will set wasEvent to true if there was an event and false otherwise.  If there
  750.  * was not enough space to fill in the whole event structure that event will be
  751.  * dequed, as much of the event as will fit in the buffer will by copied and
  752.  * ISpElementList_GetNextEvent will return an error.
  753.  *
  754.  * Return Codes
  755.  * paramErr
  756.  *
  757.  }
  758. FUNCTION ISpElementList_GetNextEvent(inElementList: ISpElementListReference; bufSize: UInt32; event: ISpElementEventPtr; VAR wasEvent: BOOLEAN): OSStatus; C;
  759. {
  760.  *
  761.  * ISpElementList_Flush
  762.  *
  763.  * It takes an ISpElementListReference and flushes all the events on that list.  All it guaruntees is
  764.  * that any events that made it to this layer before the time of the flush call will be flushed and
  765.  * it will not flush any events that make it to this layer after the time when the call has returned.
  766.  * What happens to events that occur during the flush is undefined.
  767.  *
  768.  *
  769.  * Return Codes
  770.  * paramErr
  771.  *
  772.  }
  773. FUNCTION ISpElementList_Flush(inElementList: ISpElementListReference): OSStatus; C;
  774. {
  775.  *
  776.  * ISpTimeToMicroseconds
  777.  *
  778.  *
  779.  * This function takes time from an input sprocket event and converts it
  780.  * into microseconds. (Version 1.2 or later of InputSprocket.)
  781.  *
  782.  *
  783.  * Return Codes
  784.  * paramErr
  785.  *
  786.  }
  787. FUNCTION ISpTimeToMicroseconds({CONST}VAR inTime: AbsoluteTime; VAR outMicroseconds: UnsignedWide): OSStatus; C;
  788.  
  789. {$ENDC}  {TARGET_CPU_PPC}
  790.  
  791.  
  792. {$ALIGN RESET}
  793. {$POP}
  794.  
  795. {$SETC UsingIncludes := InputSprocketIncludes}
  796.  
  797. {$ENDC} {__INPUTSPROCKET__}
  798.  
  799. {$IFC NOT UsingIncludes}
  800.  END.
  801. {$ENDC}
  802.